const express = require('express')
const app = express()

app.use((request, response, next) => {
  console.log('有人请求服务器1了');
  // console.log('请求来自于',request.get('Host'));
  // console.log('请求的地址',request.url);
  next()
})

app.get('/tableShow/tableNum', (request, response) => {
  const data = {
    tableCount: {
      data: [
        {
          id: '1',
          text: 'asdfasdf'
        },
        {
          id: '2',
          text: 'asdfasdfasdfasdf'
        }
      ]
    },
  }
  response.send(data)
})

app.listen(8084, (err) => {
  if (!err) console.log('服务器4启动成功了,请求学生信息地址为：http://localhost:8084//tableShow/TableNum');
})
